package com.system.permission.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.system.tree.entity.Tree;

@Entity
@Table(name="t_permission")
public class Permission {
	private Long permissionId;
	private String permissionName;
	private String permissionType;
	private boolean checked=false;
	private String url;
	private Tree tree;
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getPermissionId() {
		return permissionId;
	}
	public String getPermissionName() {
		return permissionName;
	}
	
	public String getPermissionType() {
		return permissionType;
	}
	public String getUrl() {
		return url;
	}
	
	public boolean isChecked() {
		return checked;
	}
	@OneToOne
	public Tree getTree() {
		return tree;
	}
	public void setPermissionId(Long permissionId) {
		this.permissionId = permissionId;
	}
	
	public void setPermissionName(String permissionName) {
		this.permissionName = permissionName;
	}
	public void setPermissionType(String permissionType) {
		this.permissionType = permissionType;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public void setTree(Tree tree) {
		this.tree = tree;
	}
	public void setChecked(boolean checked) {
		this.checked = checked;
	}
	@Override
	public String toString() {
		return "Permission [permissionId=" + permissionId + ", permissionName=" + permissionName + ", checked="
				+ checked + ", url=" + url + ", tree=" + tree + "]";
	}
	
}
